package br.ufscar.acumaaf.smc.activity;

import android.app.ListActivity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.ArrayAdapter;
import android.widget.ListView;

public class Home extends ListActivity {

	private static final String[] menu = new String[]{"Gerenciar Sensores", "Gerenciar Monitormento", 
        "Gerenciar Atividade Física", "Gerenciar Alertas", "Sincronizar dados", "Gerenciar Usuário", "Sair"};
	
	public void onCreate(Bundle b){
		
		super.onCreate(b);
		this.setListAdapter(new ArrayAdapter<String>(this, android.R.layout.simple_expandable_list_item_1,menu));
	}
	
	protected void onListItemClick(ListView l, View v, int position, long id) {
		switch (position) {
			case 0:
				//Chama a Activity GerenciaSensores
				startActivity(new Intent("CHAMA_ACTIVITY_GERENCIA_SENSORES"));
				break;
			case 1:
				//Chama a Activity GerenciaMonitoramento
				startActivity(new Intent("CHAMA_ACTIVITY_GERENCIA_SESSAO_MONITORAMENTO"));
				break;
			case 2: 
				//Chama a Activity GerenciaAtividadeFisica
				startActivity(new Intent("CHAMA_ACTIVITY_GERENCIA_ATIVIDADE_FISICA"));
				break;
			case 3:
				//Chama a Activity GerenciaAlerta
				startActivity(new Intent("CHAMA_ACTIVITY_GERENCIA_ALERTA"));
				break;
			case 4:
				//Chama a Activity SincronizarDados
				startActivity(new Intent("CHAMA_ACTIVITY_SINCRONIZA_DADO"));
				break;
			case 5:
				//Chama a Activity CadastroUsuario
				startActivity(new Intent("CHAMA_ACTIVITY_GERENCIA_USUARIO"));
				break;
			default:
				//Encerra a Activity HOMEActivity
				finish();
				break;
		}
	}
}
